﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
using CollegeWebsite.Models;

namespace CollegeWebsite.Controllers
{
    [HandleError]
    public class HomeController : Controller
    {

       
        public ActionResult Index()
        {
            var value = ControllerContext.RouteData.Route.GetRouteData(this.HttpContext);

            if (value != null)
            {
               // var b = value.Values.Values;
            }
            

          //  ViewData["Message"] = "Welcome to ASP.NET MVC!";

            return View("Index");
        }

        [DisplayName("Vai lon con chon")]
        public ActionResult About()
        {
            
            return View();
        }

        public ActionResult AddmissionForm()
        {
            //return PartialView();
            return View("About");
        }

        public ActionResult RenderMenu()
        {
            CollegeDataContext dataContext = new CollegeDataContext();
           // ViewData["Department"] = dataContext.Departments.Select(d => d.DepartmentID).ToList();
            ViewData["FacultyMenu"] = dataContext.Faculties.Select(f => f).Where(f=>f.Status).ToList();
            ViewData["DepartmentMenu"] = dataContext.Departments.Select(d => d).Where(f => f.Status).ToList();
            return View("DefaultMenu");
        }

       
       
    }
}
